package com.byt.common.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;

/**
 * 不会滚动的listview
 * 直接使用不会滚动的ListView
 */

public class NoScrollListview extends ListView {
    public NoScrollListview(Context context) {
        super(context);
        setFocusable(false);
        setEnabled(false);
    }

    public NoScrollListview(Context context, AttributeSet attrs) {
        super(context, attrs);
        setFocusable(false);
        setEnabled(false);
    }

    public NoScrollListview(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        setFocusable(false);
        setEnabled(false);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                MeasureSpec.AT_MOST); // 设置模式，要多大就有多大
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}